3.3.64 \(\int \frac {c-c \sin (e+f x)}{a+a \sin (e+f x)} \, dx\) [264]

Optimal. Leaf size=32 \[ -\frac {c x}{a}-\frac {2 c \cos (e+f x)}{f (a+a \sin (e+f x))} \]

[Out]

-c*x/a-2*c*cos(f*x+e)/f/(a+a*sin(f*x+e))

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {2814, 2727} \begin {gather*} -\frac {2 c \cos (e+f x)}{f (a \sin (e+f x)+a)}-\frac {c x}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c - c*Sin[e + f*x])/(a + a*Sin[e + f*x]),x]

[Out]

-((c*x)/a) - (2*c*Cos[e + f*x])/(f*(a + a*Sin[e + f*x]))

Rule 2727

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2814

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rubi steps

\begin {align*} \int \frac {c-c \sin (e+f x)}{a+a \sin (e+f x)} \, dx &=-\frac {c x}{a}+(2 c) \int \frac {1}{a+a \sin (e+f x)} \, dx\\ &=-\frac {c x}{a}-\frac {2 c \cos (e+f x)}{f (a+a \sin (e+f x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(79\) vs. \(2(32)=64\).
time = 0.13, size = 79, normalized size = 2.47 \begin {gather*} -\frac {c \left (f x \cos \left (\frac {f x}{2}\right )-4 \sin \left (\frac {f x}{2}\right )+f x \sin \left (e+\frac {f x}{2}\right )\right )}{a f \left (\cos \left (\frac {e}{2}\right )+\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c - c*Sin[e + f*x])/(a + a*Sin[e + f*x]),x]

[Out]

-((c*(f*x*Cos[(f*x)/2] - 4*Sin[(f*x)/2] + f*x*Sin[e + (f*x)/2]))/(a*f*(Cos[e/2] + Sin[e/2])*(Cos[(e + f*x)/2]
+ Sin[(e + f*x)/2])))

________________________________________________________________________________________

Maple [A]
time = 0.21, size = 38, normalized size = 1.19

method result size
risch \(-\frac {c x}{a}-\frac {4 c}{f a \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}\) \(32\)
derivativedivides \(\frac {2 c \left (-\frac {2}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}-\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{f a}\) \(38\)
default \(\frac {2 c \left (-\frac {2}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}-\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{f a}\) \(38\)
norman \(\frac {\frac {4 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}+\frac {4 c \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a f}-\frac {c x}{a}-\frac {c x \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a}-\frac {c x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}-\frac {c x \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right ) \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}\) \(128\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c-c*sin(f*x+e))/(a+a*sin(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

2/f*c/a*(-2/(tan(1/2*f*x+1/2*e)+1)-arctan(tan(1/2*f*x+1/2*e)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 83 vs. \(2 (34) = 68\).
time = 0.53, size = 83, normalized size = 2.59 \begin {gather*} -\frac {2 \, {\left (c {\left (\frac {\arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a} + \frac {1}{a + \frac {a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )} + \frac {c}{a + \frac {a \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}}\right )}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sin(f*x+e))/(a+a*sin(f*x+e)),x, algorithm="maxima")

[Out]

-2*(c*(arctan(sin(f*x + e)/(cos(f*x + e) + 1))/a + 1/(a + a*sin(f*x + e)/(cos(f*x + e) + 1))) + c/(a + a*sin(f
*x + e)/(cos(f*x + e) + 1)))/f

________________________________________________________________________________________

Fricas [A]
time = 0.32, size = 68, normalized size = 2.12 \begin {gather*} -\frac {c f x + {\left (c f x + 2 \, c\right )} \cos \left (f x + e\right ) + {\left (c f x - 2 \, c\right )} \sin \left (f x + e\right ) + 2 \, c}{a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sin(f*x+e))/(a+a*sin(f*x+e)),x, algorithm="fricas")

[Out]

-(c*f*x + (c*f*x + 2*c)*cos(f*x + e) + (c*f*x - 2*c)*sin(f*x + e) + 2*c)/(a*f*cos(f*x + e) + a*f*sin(f*x + e)
+ a*f)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 90 vs. \(2 (27) = 54\).
time = 0.64, size = 90, normalized size = 2.81 \begin {gather*} \begin {cases} - \frac {c f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} - \frac {c f x}{a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} - \frac {4 c}{a f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + a f} & \text {for}\: f \neq 0 \\\frac {x \left (- c \sin {\left (e \right )} + c\right )}{a \sin {\left (e \right )} + a} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sin(f*x+e))/(a+a*sin(f*x+e)),x)

[Out]

Piecewise((-c*f*x*tan(e/2 + f*x/2)/(a*f*tan(e/2 + f*x/2) + a*f) - c*f*x/(a*f*tan(e/2 + f*x/2) + a*f) - 4*c/(a*
f*tan(e/2 + f*x/2) + a*f), Ne(f, 0)), (x*(-c*sin(e) + c)/(a*sin(e) + a), True))

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 37, normalized size = 1.16 \begin {gather*} -\frac {\frac {{\left (f x + e\right )} c}{a} + \frac {4 \, c}{a {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}}}{f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sin(f*x+e))/(a+a*sin(f*x+e)),x, algorithm="giac")

[Out]

-((f*x + e)*c/a + 4*c/(a*(tan(1/2*f*x + 1/2*e) + 1)))/f

________________________________________________________________________________________

Mupad [B]
time = 6.64, size = 45, normalized size = 1.41 \begin {gather*} \frac {c\,\left (e+f\,x\right )-c\,\left (e+f\,x+4\right )}{a\,f\,\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+1\right )}-\frac {c\,x}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c - c*sin(e + f*x))/(a + a*sin(e + f*x)),x)

[Out]

(c*(e + f*x) - c*(e + f*x + 4))/(a*f*(tan(e/2 + (f*x)/2) + 1)) - (c*x)/a

________________________________________________________________________________________